import sys
import random

def f(a1,n1):
    r,t=0,0
    for i in range(n1):
        t = t*10+a1
        r = r + t
    return r
a=[[3,5],
   [0,10],
   [1,1],
   [9,9],
   [2,2],
   [2,3],
   [8,8],
   [8,1],
   [5,3],
   [3,5]
  ]

for i  in range(10):
    fin = open('{}.in'.format(i+1),'w')
    fout = open('{}.out'.format(i+1),'w')
    print(*a[i],file=fin)
    print(f(*a[i]),file=fout)
    fin.close()
    fout.close()

